<template>
	<view class="big_box">
		<!-- <myLoading></myLoading> -->
		<view class="list-view" @click="toList">
			<image class="list-view-image" src="https://image.nanjingtouyang.com/touy/2023/09/2023091517071252557.png" mode=""></image>
			<view class="list-view-text">核销明细</view>
		</view>
		<view class="check_box" @click="check">
			<view class="img_box">
				<img class="image-box" src="https://image.nanjingtouyang.com/touy/2024/07/18/ae547f60bf824eef8d46fdf0768c8477.png" />
			</view>
			
		</view>
		<view class="check_tit" @click="check">
			<view class="check-box">订单核销</view>
		</view>
	</view>
</template>

<script>
	import { spVerifyOrd } from "@/api/mine.js"
	export default {
		data(){
			return{
				qrCodeStr:'',
				shopId:'',
				userId:'',
				checkType: ''
			}
		},
		onLoad(option){
			this.checkType = option.checkType
			this.userId=uni.getStorageSync('userId')
		},
		methods: {
			toList() {
				uni.navigateTo({
					url: '../../pages/check-list/index'
				})
			},
			check(){
				const _that=this
				uni.scanCode({
					scanType: ['qrCode'],
					success: function (res) {
						let data = res.result
						
						spVerifyOrd({
							ordCode: data
						})
						.then(res => {
							if(res.data.code == 200) {
								uni.showToast({
									title:'核销成功',
									icon: 'none'
								})
							}else {
								uni.showToast({
									title:res.data.msg,
									icon: 'none'
								})
							}		
						})
					}
				})
				 
			
			}
		},
	}
</script>

<style lang="scss">
	page {
		background-color: #fff;
	}
	.big_box{
		box-sizing: border-box;
	}
	.list-view {
		width: 100%;
		display: flex;
		justify-content: flex-end;
		padding: 0 40rpx;
		box-sizing: border-box;
		.list-view-image {
			width: 40rpx;
			height: 40rpx;
		}
		.list-view-text {
			font-size: 30rpx;
			font-weight: 400;
			color: #46973B;
			line-height: 40rpx;
			margin-left: 10rpx;
		}
	}
	.check_box{
		padding-top: 146rpx;
		box-sizing: border-box;
		width: 100%;
		margin: 0 auto;
		width: 434rpx;
		height: 506rpx;
	}
	.img_box{
		width: 100%;
		height: 100%;
	}
	.image-box {
		width: 100%;
		height: 100%;
	}
	.check_tit{
		width: 100%;
		text-align: center;
		font-size: 50rpx;
		margin-top: 200rpx;
	}
	.check-box {
		width: 660rpx;
		height: 90rpx;
		background: linear-gradient(180deg, #8FC55C 0%, #3F8E5E 100%);
		font-size: 32rpx;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 90rpx;
		margin: 0 auto;
		border-radius: 20rpx;
	}
</style>